<template>
    <IModal v-model="defaultValue" :loading="loading" :width="650" title="回执日志">
        <Row>
            <BoxCell title="清单号">{{data.invt_no}}</BoxCell>
            <BoxCell title="预录入编号">{{data.pre_no}}</BoxCell>
            <BoxCell title="说明">{{data.info}}</BoxCell>
            <BoxCell title="文件"><a :href="`/storage/${data.file}`" target="_blank">{{data.file}}</a></BoxCell>
        </Row>
        <Tabs>
            <TabPane label="日志" name="name1">
                <Table :columns="columns" :data="data.logs" :height="300"></Table>
            </TabPane>
        </Tabs>
    </IModal>
</template>

<script>
    import contentDrawer from "../../../mixins/contentDrawer";
    import RemoteSelect from "../../../components/form/remoteSelect";
    import IModal from "../../../components/content/modal";
    import BoxCell from "../../../components/content/boxCell";

    export default {
        name: "create",
        mixins: [contentDrawer],
        components: {BoxCell, IModal, RemoteSelect},
        data() {
            return {
                loading: true,
                data: {logs: []},
                columns: [{
                    title: '海关回执时间',
                    key: 'last_time'
                }, {
                    title: '说明',
                    key: 'info'
                }, {
                    title: '入库时间',
                    key: 'created_at'
                }]
            }
        },
        mounted() {
            this.getData();
        },
        methods: {
            getData() {
                this.$http.get(`order/inventory/${this.props.id}`).then((res) => {
                    this.data = res;
                }).finally(() => {
                    this.loading = false;
                });
            }
        }
    }
</script>

<style scoped>

</style>
